<template>
  <div>
    <V-CommonHeaderLeft>
      <div id="app">
        <el-row>
          <!-- 头部 -->
          <div class="header">
            <el-col :span="3" class="header-nav">
              <router-link to="/">首页&nbsp;&nbsp;/</router-link>
              <router-link to="/">客户&nbsp;&nbsp;/</router-link>
              <router-link to="/">客户咨询</router-link>
            </el-col>
            <el-col :span="1" :offset="20" class="header-img">
              <!-- <img src="" alt=""> -->
            </el-col>
          </div>
        </el-row>
        <div class="contents">
          <el-row>
            <el-col :span="3">
              <input type="search" class="search" placeholder="请输入商品搜索">
            </el-col>
          </el-row>
          <div style="background-color:#fff;padding-top:20px;">
            <!--开始列表-->
            <el-row class="tableRow">
              <el-col :span="1">序号</el-col>
              <el-col :span="5">客户名称</el-col>
              <el-col :span="5">最近沟通</el-col>
              <el-col :span="3" :offset="1">沟通时间</el-col>
              <el-col :span="3" :offset="2">最近回复</el-col>
              <el-col :span="2" :offset="2">状态</el-col>
            </el-row>
            <div class="scroll">
              <el-row
                class="tableData"
                v-for="(site,key) in tableData"
                :key="key"
                @mouseover.native="changeMask(key)"
                @mouseout.native="changeOut()"
              >
                <el-col :span="1">{{++key}}</el-col>
                <el-col :span="5" class="tableData-td1" @click.native='showChats()'>{{site.title}}</el-col>
                <el-col :span="5" class="tableData-td">{{site.content1}}</el-col>
                <el-col :span="3" :offset="1" class="time">{{site.time}}</el-col>
                <el-col :span="3" :offset="2" class="objects">{{site.objects}}</el-col>
                <el-col :span="2" :offset="2" class="state">{{site.state}}</el-col>
                <el-col class="hoverKuang" v-if="key == i" :style="{opacity:opacity}">
                  <router-link to="/">回复</router-link>
                </el-col>
              </el-row>
            </div>
          </div>
          <div class="chat" v-show="showChat">
            <div class="chat-title">
              <p>凯妮化妆品有限公司的咨询</p>
              <p @click="hiddenChat()">x</p>
            </div>
            <div class="chat-footer">
              <el-input
                type="textarea"
                placeholder="请输入……"
                v-model="textarea"
                maxlength="140"
                show-word-limit
                rows="5"
                class="chatTextarea"
                resize="none"
              ></el-input>
              <button>发送</button>
            </div>
          </div>
        </div>
        <!-- 引入公共组件分页 -->
      </div>
    </V-CommonHeaderLeft>
  </div>
</template>

<script>
import VCommonHeaderLeft from '@/components/common/vCommonHeaderLeft/VCommonHeaderLeft'
export default {
  components: {
    VCommonHeaderLeft
  },
  data () {
    return {
      showChat: false,
      opacity: 0,
      i: true,
      tableIndex: 0,
      textarea: '',
      tableData: [
        {
          show: true,
          title: 'qwe',
          content1: '打折',
          content2: '【订单满20元享1折】',
          time: '2019.5.30~2019.6.30',
          objects: '普通代理商，金牌代理商',
          state: '促销中'
        },
        {
          show: true,
          title: 'u回到顶端开始交往i第九十八',
          content1: '直降',
          content2: '【订单满100元赠[示例商品]】',
          time: '2019.5.30~2019.6.30',
          objects: '普通代理商，金牌代理商',
          state: '促销中'
        }]
    }
  },
  methods: {
    changeMask (key) {
      this.opacity = 1
      this.i = key
    },
    changeOut () {
      this.opacity = 0
    },
    hiddenChat () {
      this.showChat = false
    },
    showChats () {
      this.showChat = true
    }
  }
}
</script>

<style lang="scss" scoped>
#app {
  background-color: #f2f5f7;
  width: 100%;
  padding: 15px 10px 0px 10px;
  .header {
    height: 45px;
    .header-nav {
      line-height: 30px;
      font-size: 12px;
      display: flex;
      justify-content: space-around;
      padding-left: 10px;
      span {
        display: inline-block;
        margin-left: 10px;
      }
      a {
        color: #999999;
      }
      a:hover {
        color: #20ade5;
      }
    }
    .header-img {
      width: 25px;
      height: 25px;
      border-radius: 5px;
      border: 1px solid #dce4e7;
    }
  }
}
.header-nav > a:last-child {
  color: #333 !important;
}
.header-nav > a:last-child:hover {
  color: #333;
}
.search {
  border: 1px solid #dcdfe6;
  width: 240px;
  height: 38px;
  margin-top: 2px;
  text-indent: 1em;
}
.search::placeholder {
  color: #b3b3b3;
}
.contents /deep/ .el-row {
  padding: 15px 0px 0px 25px;
  background-color: #fff;
  font-size: 12px;
  .select-style /deep/ .el-input__inner {
    height: 37px;
    border-radius: 0;
    width: 130px;
    font-size: 12px;
  }
}
.contents-select-data {
  margin-top: 3px;
}
.contents-add-plus {
  display: flex;
  font-size: 15px;
  color: #20ade5;
  margin-top: 10px;
}
.elTable {
  height: 430px;
  border-top: 1px solid #e4e4e4;
  border-bottom: 1px solid #e4e4e4;
}
.elTable /deep/ th {
  height: 50px;
}
.elTable /deep/ .el-table td {
  padding: 0;
}
.scroll {
  overflow-x: hidden;
  overflow-y: scroll;
  height: 375px;
}
.tableRow {
  border-top: 1px solid #e3e3e3;
  border-bottom: 1px solid #e3e3e3;
  height: 50px;
  background-color: #fcfcfc !important;
  line-height: 30px;
}
.tableData {
  border-top: 0;
  border-bottom: 1px solid #e3e3e3;
  height: 40px;
  background-color: #fff !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  line-height: 40px;
}
.tableData:hover {
  background-color: #f5f5f5 !important;
}
.tableData-td1 {
  padding-left: 3px;
  cursor: pointer;
}
.tableData-td1:hover {
  color: #80b4e9;
}
.tableData-td {
  display: flex;
  padding-left: 4px;
}
.tableData-td span:nth-child(1) {
  display: block;
  width: 38px;
  height: 18px;
  background-color: #ff3838;
  color: #fff;
  border-radius: 5px;
  text-align: center;
  line-height: 18px;
  margin-top: 10px;
  font-size: 12px;
}
.hoverKuang {
  width: 70px;
  height: 40px;
  background-color: #a3bbd4;
  font-size: 12px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  position: absolute;
  right: 0px;
}
.time {
  padding-left: 9px;
}
.objects {
  padding-left: 13px;
}
.state {
  padding-left: 16px;
}
.hoverKuang a {
  color: #fcfdfd;
}
.chat {
  width: 900px;
  height: 595px;
  border: 1px solid;
  position: absolute;
  top: 30px;
  left: 230px;
  background-color: #fff;
  z-index: 1000;
}
.chat-title {
  background-color: #f5f5f5;
  height: 50px;
  line-height: 50px;
  display: flex;
}
.chat-title > p:nth-child(1) {
  margin-left: 43%;
}
.chat-title > p:nth-child(2) {
  margin-left: 33%;
  color: #7f7f7f;
  cursor: pointer;
}
.chatTextarea {
  position: fixed;
  width: 900px;
  bottom: 31px;
  border-top: 1px solid #e3e3e3;
}
.chatTextarea /deep/ .el-textarea__inner {
  border: 0;
}
.chat-footer > button {
  position: absolute;
  bottom: 20px;
  right: 10px;
  border: 0;
  width: 80px;
  height: 30px;
  border-radius: 5px;
  color: #fff;
  font-size: 12px;
  text-align: center;
  line-height: 30px;
  background-color: #20ade5;
  cursor: pointer;
}
.chat-footer > button:hover {
  background-color: rgba($color: #20ade5, $alpha: 0.7);
}
</style>
